package jp.sourceforge.akjrcp.audiotools;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;

import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class AudioToolsSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String PATH_PITCH2="audiotools.path_pitch2";
	public static final String PATH_FORMANT="audiotools.path_formant";
	public static final String PATH_SPECTRAM="audiotools.path_spectram";
	
	//public static final String PATH_ASCII_TEMPORARY="audiotools.ascii_temporary";
	public static final String PATH_SPECTRAM_IMAGES="audiotools.path_spectram_images";
	public AudioToolsSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("audiotools.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		
		
        
		
		  FileFieldEditor filefield;
		  filefield=new FileFieldEditor(
				  PATH_PITCH2, Messages.getString("audiotools.path_pitch2"),getFieldEditorParent()); //$NON-NLS-1$
		  filefield.setFileExtensions(new String[]{"pitch2.exe"}); //$NON-NLS-1$
	      addField(filefield);
	      
	      filefield=new FileFieldEditor(
				  PATH_FORMANT, Messages.getString("audiotools.path_formant"),getFieldEditorParent()); //$NON-NLS-1$
		  filefield.setFileExtensions(new String[]{"formant.exe"}); //$NON-NLS-1$
	      addField(filefield);
	      
	      filefield=new FileFieldEditor(
				  PATH_SPECTRAM, Messages.getString("audiotools.path_spectram"),getFieldEditorParent()); //$NON-NLS-1$
		  filefield.setFileExtensions(new String[]{"spectram.exe"}); //$NON-NLS-1$
	      addField(filefield);
	      
	      addField(new DirectoryFieldEditor(PATH_SPECTRAM_IMAGES,Messages.getString(PATH_SPECTRAM_IMAGES),getFieldEditorParent()));
	}

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
